package org.extreme.model.cell;

import org.extreme.model.dom.XElement;
import org.extreme.model.managers.DataSetSourceManager;

public class DataFieldElement implements XElement {
	private String dsName;
	private String fieldName;
	
	public void setDsName(String dsName) {
		this.dsName = dsName;
	}
	
	public String getDsName() {
		return dsName;
	}
	
	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}
	
	public String getFieldName() {
		return fieldName;
	}
	
	public Object[] list(DataSetSourceManager dataSetSourceManager) {
		// TODO:
		return null;
	}

	public int hashCode() {
		return this.dsName == null ? 0 : this.dsName.hashCode()
				+ this.fieldName == null ? 0 : this.fieldName.hashCode();
	}
	
	public boolean equals(Object obj) {
		if (! (obj instanceof DataFieldElement)) {
			return false;
		}
		
		DataFieldElement dataFieldElement = (DataFieldElement)obj;
		
		return (this.dsName == null ? dataFieldElement.dsName == null : this.dsName.equals(dataFieldElement.dsName))
			&& (this.fieldName == null ? dataFieldElement.fieldName == null : this.fieldName.equals(dataFieldElement.dsName));
	}
	
	
}
